package com.netease.streamlearningbyjava.bean;

import java.util.Objects;

/**
 * 创建日期：2021/10/29 14:01
 *
 * @author tony.sun
 * 类说明：
 */

public class Employee2 {
    private String name;
    private Integer age;
    private Double salary;
    private Status Status;

    public Employee2(String name, Integer age, Double salary, Employee2.Status status) {
        this.name = name;
        this.age = age;
        this.salary = salary;
        Status = status;
    }

    /**
     * 闲着，忙碌，休假
     */
    public enum Status{
        FREE,
        BUSY,
        VOCATION;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Double getSalary() {
        return salary;
    }

    public void setSalary(Double salary) {
        this.salary = salary;
    }

    public Employee2.Status getStatus() {
        return Status;
    }

    public void setStatus(Employee2.Status status) {
        Status = status;
    }

    @Override
    public String toString() {
        return "Employee2{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", salary=" + salary +
                ", Status=" + Status +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Employee2 employee2 = (Employee2) o;
        return Objects.equals(name, employee2.name) &&
                Objects.equals(age, employee2.age) &&
                Objects.equals(salary, employee2.salary) &&
                Status == employee2.Status;
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age, salary, Status);
    }


}
